package esya;

import java.sql.*;

public class InsertVal {
	
	String tableName="EVENTS";
	String r1="'Stratagem', 'StockMarket@stocks@market', '3Sep', '1400-1700', 'CR4&CR5', '45k'";
	String r2="'Pwned', 'onlinegaming@gaming', '3Sep', '1400-1700', 'CR4&CR5', '30k'";
	public void insert() throws ClassNotFoundException, SQLException{
		
		Class.forName("com.mysql.jdbc.Driver");
		String url = "jdbc:mysql://localhost/mysql?" + "user=root&password=";
	    Connection conn = DriverManager.getConnection(url);
		
		Statement stmt = null;
        //ResultSet rs = null;
        
        //System.out.println("before insert");
		
		String createString;
		
		createString= "INSERT INTO "+tableName+" VALUES"+"("+r1+")";
		stmt = conn.createStatement();
        stmt.executeUpdate(createString);
        
        createString= "INSERT INTO "+tableName+" VALUES"+"("+r2+")";
		stmt = conn.createStatement();
        stmt.executeUpdate(createString);

        System.out.println("values inserted");
        	stmt.close();
            conn.close();
		

}
}
